/**
 * @file   UrlManager.hpp
 * @author Liu Yuan <liuyuan@net.pku.edu.cn>
 * @date   Sun Jun 17 23:12:06 2007
 *
 * @brief This file
 *
 *
 */

#ifndef __URLMANAGER_HPP
#define __URLMANAGER_HPP

#include <vector>
#include <string>
#include <set>

#include "util/MyDb.hpp"             // For url seen
#include "Host.hpp"

class UrlManager
{
public:
    UrlManager(const std::string& crUrlDbName);
    bool UrlProcess(std::string& crUrlStr, Host& rHost);

    void test(std::string& crUrlStr);

private:
    bool Normalization(std::string& rUrl);
    bool IsUrlVisited(const std::string& crUrl);
    bool IsFiltered(const std::string& crUrl, Host& rHost);
    //     bool ParseUrl(const std::string& crUrl, Url& rUrlStruct);

private:
    std::vector<std::string> mGlobalRules;
    MyDb                     mUrlSeenDb;
    //     Host                     mHost; // to be config
};

#endif
